home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
olrdrs
/
qprn112.zip
/
PARMSCAN.DOC
< prev
next >
Wrap
Text File
|
1994-05-12
|
2KB
|
49 lines
PARMSCAN scans a set of batch file parameters to see if any of them
contain a given string.
The format is:
PARMSCAN string [parameters]
For example, "PARMSCAN .REP %1 %2 %3 %4 %5 %6 %7 %8 %9" (w/o quotes)
will scan all the available parameters for ".REP". PARMSCAN does
case-insensitive matching, so this line would also find ".rep", or
".Rep".
PARMSCAN returns an errorlevel of 0 if "string" is found, otherwise it
returns an errorlevel of 1.
You can check for a match with "IF NOT ERRORLEVEL 1". To see if there
wasn't a match, use "IF ERRORLEVEL 1". For the example above, you could
use "IF NOT ERRORLEVEL 1 EXIT" (no quotes) to quit the batch file if
".REP" was in any of the parameters.
Remember that, when DOS sets an errorlevel, it also sets all lower
errorlevels. That's why "IF ERRORLEVEL 0" can't be used to tell if
"string" was in any of the parameters.
If you're running a batch file from another application, and want to
return to it if "string" isn't found, you can use "PARMSCAN %1 %1"
(again w/o quotes) to force an errorlevel of 0 to be returned to the
application. This may be needed if the application assumes that an
error occurred.
-----
PARMSCAN.EXE and this documentation are Copyright (c) 1993 by David
Harden. All rights reserved. PARMSCAN is Freeware, there is no charge
for using it.
You may copy and distribute PARMSCAN provided that PARMSCAN.EXE and this
documentation are distributed in their original, unaltered forms. You
may not charge any fee for copying and distributing PARMSCAN other than a
minimal fee to cover the costs incurred.
You may bundle and/or include PARMSCAN with other software, as long as
you include this documentation, and do not charge for it.
There is no warranty of any kind, either express or implied, covering
this software or this documentation. The copyright holder is in no way
responsible or liable for any losses or damages of any kind that may
result from the use of this software or this documentation, or from
inability to use them.